import 'package:flutter/material.dart';

// Custom Text Styles Class For Both Dark and Light Theme
class CustomTextTheme {
  static const _textColorLight =
      Color(0xFF555555); // Light Theme Default Text Color
  static const _textColorDark =
      Color(0xFFdddddd); // Dark Theme Default Text Color

  static TextTheme get textThemeLight {
    return _textTheme(textColor: _textColorLight);
  }

  static TextTheme get textThemeDark {
    return _textTheme(textColor: _textColorDark);
  }

  // Private Method For Text Theme so that we can change the vale for Both Dark And Light Theme
  static TextTheme _textTheme({required Color textColor}) {
    const FontWeight _light = FontWeight.w300;
    const FontWeight _medium = FontWeight.w500;
    const FontWeight _regular = FontWeight.w400;

    return TextTheme(
      titleMedium: TextStyle(
        fontFamily: 'Montserrat',
        fontSize: 21,
        color: textColor, //这样就会限制，无论在light还是dart下，subtitle1的颜色都不会改变
        fontWeight: _medium,
        letterSpacing: 1.8,
      ),
      titleSmall: TextStyle(
        fontFamily: 'Montserrat',
        fontSize: 20,
        color:
            textColor, //这样就会跟着两种主题文字颜色，也就是上面定义的_textColorLight  _textColorDark
        fontWeight: _medium,
        letterSpacing: 0.0,
      ),
      displayLarge: TextStyle(
        fontSize: 96,
        fontFamily: 'Montserrat',
        color: textColor,
        fontWeight: _light,
        letterSpacing: -1.5,
      ),
      displayMedium: TextStyle(
        fontFamily: 'Montserrat',
        color: textColor,
        fontSize: 60,
        fontWeight: _light,
        letterSpacing: -0.5,
      ),
      displaySmall: TextStyle(
        fontFamily: 'Montserrat',
        color: textColor,
        fontSize: 48,
        fontWeight: _regular,
        letterSpacing: 0.0,
      ),
      headlineMedium: TextStyle(
        fontFamily: 'Montserrat',
        color: textColor,
      ),
      headlineSmall: TextStyle(
        fontFamily: 'Montserrat',
        color: textColor,
      ),
      titleLarge: TextStyle(
        fontFamily: 'Montserrat',
        color: textColor,
      ),

      bodyLarge: TextStyle(
        fontFamily: 'Montserrat',
        color: textColor,
        fontSize: 16,
        fontWeight: _regular,
        letterSpacing: 0.5,
      ),
      //书本的标题使用的是这个textstyle
      bodyMedium: TextStyle(
        fontFamily: 'Montserrat',
        color: textColor,
        fontSize: 18,
        fontWeight: _regular,
        letterSpacing: 0.25,
      ),
      labelLarge: TextStyle(
        fontFamily: 'Montserrat',
        color: textColor,
        fontSize: 14,
        fontWeight: _medium,
        letterSpacing: 1.25,
      ),
      bodySmall: TextStyle(
        fontFamily: 'Montserrat',
        color: textColor,
        fontSize: 25,
        letterSpacing: 1,
      ),
      labelSmall: TextStyle(
        fontFamily: 'Montserrat',
        color: textColor,
        fontSize: 10,
        fontWeight: _regular,
        letterSpacing: 1.5,
      ),
    );
  }
}
